var deviceone = require("deviceone");
var nf = deviceone.sm("do_Notification");
var http = require("helper/httpSilence");
var userUrl = require("url/user");
var userHelper = require("helper/user");

module.exports.type = {
		/** COMMUNITY_MESSAGE * */
		COMMUNITY_MESSAGE : 1,
		/** CIRCLE_TOPIC * */
		CIRCLE_TOPIC : 2,
	};

/**
 * shieldUserId:屏蔽用户id,type:屏蔽信息类型
 */
module.exports.addShield = function(shieldUserId,type) {
	if(null==userHelper.loginToken()||''==userHelper.loginToken()){
		nf.toast("请先登录。")
		return;
	}
	if(shieldUserId==userHelper.userId()){
		nf.toast("请不要屏蔽自己的信息。")
		return;
	}
	http.post(userUrl.url.shield.add, {shieldUserId:shieldUserId,type:type}, function(data) {
		nf.toast("屏蔽成功。")
	});
};
